From 521a59b6f461232a008fba62f79bbb14f487b16e Mon Sep 17 00:00:00 2001 From: Justin Burkett Date: Thu, 25 Nov 2021 22:45:35 -0500 Subject: [PATCH] Respect which-key-min-display-lines setting Fixes #325 --- which-key.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/which-key.el b/which-key.el index e55197ee4a0..0fa2fa39ad7 100644 --- a/which-key.el +++ b/which-key.el @@ -1973,6 +1973,13 @@ is the width of the live window." (or prefix-title (which-key--maybe-get-prefix-title (key-description prefix-keys)))) + (when (and (= (which-key--pages-num-pages result) 1) + (> which-key-min-display-lines + (which-key--pages-height result))) + ;; result is shorter than requested, so we artificially increase the + ;; height. See #325. Note this only has an effect if + ;; `which-key-allow-imprecise-window-fit' is non-nil. + (setf (which-key--pages-height result) which-key-min-display-lines)) (which-key--debug-message "Frame height: %s Minibuffer height: %s Max dimensions: (%s,%s) -- 2.30.2